package com.wjyxsy.service.impl;

import com.wjyxsy.service.IUserService;
import org.apache.commons.lang3.RandomUtils;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;
import java.util.concurrent.TimeUnit;

@Service
public class UserServiceImpl implements IUserService {

    @Override
    public String sayHello1(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep(RandomUtils.nextLong(0, 100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("sayHello1 name=" + name);
        return name;
    }

    @Override
    public String sayHello2(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep(RandomUtils.nextLong(0, 100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("sayHello2 name=" + name);
        return name;
    }

    @Override
    public String sayHello3(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep(RandomUtils.nextLong(0, 100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("sayHello3 name=" + name);
        return name;
    }
}
